<template>
  <span :class="changeColor" >{{index+1}}.{{res}}</span>
</template>

<script>
export default {
  props: ['index','res'],
  computed:{
    changeColor(){
      if(this.res=="正确"){
        return 'right'
      }else if(this.res=='错误'){
        return 'error'
      }else{
        return 'undo'
      }
    }
  }
};
</script>

<style scoped>
.right {
  color: green;
}
.error {
  color: red;
}
.undo {
  color: #ccc;
}
</style>